package com.aisile.crowd_funding.common.controller;

import com.aisile.crowd_funding.system.pojo.SysUser;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;

/**
 * @标题 BaseController
 * @作者 Mr.chen
 * @创建日期 2018/12/6 13:36
 * @版本号 1.0
 **/
public class BaseController {

    public Subject getSubject(){
        return SecurityUtils.getSubject();
    }

    public SysUser getLoginUser(){
        return (SysUser)getSubject().getPrincipal();
    }

    public String getLoginUserName(){
        return getLoginUser().getUsername();
    }
}
